System and method for communicating with an integrated circuit

ABSTRACT

A system and method for communicating with an integrated circuit is provided that allows an integrated circuit to communicate debugging information and system bus transaction information with an external system. The system may include an interface protocol that provides flow control between the integrated circuit and the external system. The system may include a high-speed link and/or a JTAG link for communicating information. A link may be automatically selected by a debug circuit, or selected by an on-chip device or external system. The high-speed link enables real-time collection of trace information. Links may be memory-mapped, such that on-chip devices and other devices attached to the system bus may access the external system. The high-speed link may also operate at a rate which is integrally coupled with a rate of the processor or system bus. Further, the high-speed link may be adapted to change speeds in response to a change in operating speed of the system bus or processor. The JTAG interface may utilize standard JTAG components and instructions such that external devices such as debug adaptors adopting these components and instructions may be re-used for different integrated circuit types. Information transmitted over the JTAG or high-speed link may be compressed to optimize available bandwidth of the links. Also, processor control signals can be transferred through links that allow an external system to manipulate and monitor operation of the processor and its associated modules.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention relates generally to communication protocols andinterfaces, and more specifically, to a system and method forcommunicating with an integrated circuit.

2. Related Art

System-on-chip devices (SOCs) are well-known. These devices generallyinclude a processor, one or more modules, bus interfaces, memorydevices, and one or more system busses for communicating information.Because multiple modules and their communications occur internally tothe chip, access to this information is generally difficult whenproblems occur in software or hardware. Thus, debugging on these systemsis not straightforward. As a result of development of these SOCs,specialized debugging systems have been developed to monitor performanceand trace information on the chip. Such systems typically includededicated hardware or software such as a debug tool and debug softwarewhich accesses a processor through serial communications.

However, debugging an SOC generally involves intrusively monitoring oneor more processor registers or memory locations. Accesses to memorylocations are sometimes destructive, and a data access to a locationbeing read from a debugging tool may impede processor performance.Similarly, accesses are generally performed over a system bus to theprocessor, memory, or other module, and may reduce available bandwidthover the system bus for performing general operations. Some debuggingsystems do not perform at the same clock speed as that of the processor,and it may be necessary to slow the performance of the processor toenable use of debugging features such as obtaining trace information. Byslowing or pausing the processor, some types of error may not bereproduced, and thus cannot be detected or corrected. Further, accurateinformation may not be available altogether due to a high speed of theprocessor; information may be skewed or missing.

Some systems include one or more dedicated functional units within theSOC that are dedicated to debugging the processor, sometimes referred toas a debug unit or module. However, these units affect the operation ofthe processor when obtaining information such as trace information.These units typically function at a lower speed than the processor, andthus affect processor operations when they access processor data. Forexample, when transmitting trace information off-chip, trace informationmay be generated at a rate that the debug module can process or transmitoff-chip, and the processor must be slowed to avoid losing traceinformation. The debug module relies upon running debug code on thetarget processor itself, and this code is usually built into the systembeing debugged, referred to as the debugee. Thus, the presence of thedebug code is intrusive in terms of memory layout, and instructionstream disruption.

Other debugging systems referred to as in-circuit emulators (ICEs) matchon-chip hardware and are connected to it. Thus, on-chip connections aremapped onto the emulator and are accessible on the emulator which isdesigned specifically for the chip to be tested. However, emulators areprohibitively expensive for some applications because they arespecially-developed hardware, and do not successfully match all on-chipspeeds or communications. Thus, emulator systems are inadequate.Further, these systems generally transfer information over the systembus, and therefore necessarily impact processor performance. These ICEsgenerally use a proprietary communication interface that can onlyinterface with external debug equipment from the same manufacturer.

Another technique for troubleshooting includes using a Logic StateAnalyzer (LSA) which is a device connected to pins of the integratedcircuit that monitors the state of all off-chip communications. LSAdevices are generally expensive devices, and do not allow access to pininformation inside the chip. In sum, there are many systems which areinadequate for monitoring the internal states of a processor and forproviding features such as real-time state and real-time trace in anon-intrusive manner.

Further, some debugging circuits make use of an interface referred inthe art to as a JTAG (Joint Test Action Group) interface defined by IEEE1149.1-1990 standard entitled Standard Test Access Port andBoundary-Scan Architecture. The specification was adopted as an IEEEstandard in February 1990, and JTAG interfaces are commonly provided inintegrated circuit systems. IEEE standard 1149.1 allows testinstructions and data to be serially loaded into a device and enablesthe subsequent test results to be serially read out. JTAG interfaces areprovided to allow designers to efficiently access internal parameters ofintegrated circuits to perform a boundary scan test on an integratedcircuit (IC) device to detect faults in the IC. Boundary scan testing iswell-known in the art of IC and ASIC development.

Every IEEE standard 1149.1-compatible device includes an interfacehaving four additional pins—two for control and one each for input andoutput serial test data. To be compatible, a component must have certainbasic test features, but IEEE standard 1149.1 allows designers to addtest features to meet their own unique requirements.

Some systems provide a method by which a JTAG interface associated withan integrated circuit may be reused to transfer debugging information.In one approach, a single JTAG instruction is used to place the JTAGport into a mode whereby JTAG pins are reused to form a link between theintegrated circuit and another system. Signals on the JTAG pins in thismode are not conformant with the IEEE 1149.1 JTAG standard, nor do theyobey any of the JTAG standard rules and thus cannot be connected to astandard JTAG device. In addition, the JTAG interface is a low-speedlink, and is generally not capable of transferring information at a highrate of speed (in the MBit/s range of transmission and higher). Thus, animproved interface is needed for accessing an integrated circuit.

SUMMARY OF THE INVENTION

These and other drawbacks of conventional debug systems are overcome byproviding an interface and protocol for communicating with an integratedcircuit.

Further, a high-speed link is provided for obtaining information from anintegrated circuit. Because the interface operates at a high rate ofspeed, real-time collection of trace information is possible. Further,the trace information transferred includes all of the information thatan external system would use for debugging a processor. Also, the linkmay be memory-mapped such that an on-chip processor or other deviceassociates with the integrated circuit may execute software located onthe external system and on-chip devices may perform system bustransactions with a memory or storage device of the external system. Inone aspect, the system includes an interface protocol that provides flowcontrol between an integrated circuit and external system withoutrequiring additional flow control pins.

According to another aspect of the invention, trace informationcommunicated over the interface includes both address information andmessage information. In another aspect, the trace information includestiming information.

In another aspect of the invention, the link operates at a rate which isproportional to an operating rate of a processor system bus. In oneaspect, the rate of the link changes as the rate of the system buschanges. Thus, debug information generated on-chip will not overwhelmthe transmission capabilities link because the link speed is derivedfrom the internal system bus rate.

In another aspect of the invention, an external system is capable ofstopping, starting, and resetting the processor through the externallink. In one embodiment, signals are provided for controlling theprocessor. In another embodiment, the external system is capable ofwriting to a register in a debug circuit to effect processor control.

In another aspect, the trace information may be compressed by the tracesystem. By compressing information, trace information is preserved fortransmission over lower-bandwidth links and maximizes on-chip tracestorage. For example, trace information may be compressed by compressingtimestamp and address information. Further, trace information may becompressed by omitting duplicate types of information, such as one tracepacket of a particular operation type. Also, information may be filteredby predefining criteria upon which trace information is generated. Byfiltering information and eliminating duplicate information on-chip,bandwidth requirements of links to external systems and on-chip storagerequirements are reduced.

In another aspect, request information originating from an externaldevice may also be compressed. In one embodiment, it is realized thatthe external system transmits only request messages, so that a messagetype field may be omitted. In another embodiment, transmission ofinformation is minimized by transmitting, before a data message, statusinformation indicating that a valid message is available to betransmitted.

In another aspect, a standard JTAG interface is used, and therefore,standard off-the-shelf JTAG components and JTAG commands may beimplemented. Also, external systems such as debug adapter boards usingJTAG components and the JTAG protocol may be reused for debuggingdifferent types of integrated circuits utilizing standard JTAG features.

According to another embodiment, both a JTAG interface and high-speedinterface are available, and in one embodiment, both the interfacesimplement an identical messaging protocol. Thus, because both interfacesutilize an identical messaging protocol, the amount of hardware in theintegrated circuit may be reduced. Further, because the same messagingstructures are used, the same functionality is provided for bothinterface types. Also, a mechanism may be provided wherein a link isselected automatically by the debug circuit or other device associatedwith integrated circuit 101, or is selectable by a user operating theexternal system.

According to another aspect of the invention, a message format isprovided that minimizes the amount of information to be transferred overa JTAG interface. In particular, information regarding whether a messageis available is transmitted before data information within a shiftregister.

These an other advantages are provided by a method for communicatingbetween a debug circuit of an integrated circuit and an external system.The method comprises steps of sending a first request message; receivinga second request message, said second request message indicating that areceive processor may receive another request message; and sending athird request message. According to one embodiment, messages aretransmitted over an output data path and are received over an input datapath wherein the input and output paths operate independently from oneanother. According to another embodiment, the output data path is widerthan the input data path.

The input data path may be, for example, 1 bit wide. According to oneembodiment, the output data path is 4 bits wide.

According to another embodiment, the steps of sending request messagesincludes sending a start of message indication; and sending anend-of-message indication. According to another aspect, the requestmessages are system bus request messages.

According to one embodiment, contents of the request messages areidentified and specify the response required to each request message.According to another embodiment, the system bus request messagesoriginate from one or more devices coupled to a system bus associatedwith the integrated circuit.

According to another aspect, input data of an input message is providedin phase with an input clocking signal. According to one embodiment,output data of an output message is provided that is in phase with anoutput clocking signal. According to yet another embodiment, the thirdrequest message is located in a buffer, and is transmitted in responseto receiving the second request message. According to another aspect, anoutput transmission clock used to clock output data is determined froman internal system bus clock. According to one embodiment, aprogrammable divider determines the output transmission clock frequency.

According to another embodiment, the programmable divider is programmedby a system external to the integrated circuit. According to anotheraspect, the output transmission clock is an integral frequency of thesystem bus clock. According to one embodiment, the system clock isdynamically changed to conserve power. According to another embodiment,the external system issues a command to transfer the processor from astandby state into an operating state. According to another aspect, theexternal system monitors a status indicator to determine if theprocessor is operating normally. According to one embodiment, theexternal system waits a predetermined amount of time to allow theprocessor to stabilize. According to another embodiment, the externalsystem may perform one of either waiting a predetermined amount of timeto allow the processor to stabilize; and monitoring a status indicatorto determine if the processor is operating normally. According toanother aspect of the invention, the external system delays sending ofrequests until the processor is operating normally.

According to one embodiment, an input message is compressed by omittinga type field.

According to another embodiment, an output message is a variable-lengthmessage determined by the contents of the message. According to anotheraspect, an output message is not dependent on debug adapter bufferstatus. According to one embodiment, the debug circuit indicates, in abit of the output idle word, whether the receive buffer of the module isempty. According to another embodiment, output messages are one of tracemessages and system bus transactions. According to another aspect, anidle word separates two output messages. According to one embodiment,the system bus transaction is a request to an address space of theexternal system.

According to another embodiment, a message type field of a trace messageindicates that the trace message is at least one of, a trigger tracemessage type; and a background trace message type.

According to another aspect, the request to the address space of theexternal system is at least one of the group of reading from a memoryaddress, storing to a memory address; and writing to a memory addressand returning a previous value of the memory address.

According to another aspect, a method is provided for communicatingbetween an integrated circuit and an off-chip device. The methodcomprises steps of transmitting a message off-chip at a transmissionfrequency proportional to an on-chip at a transmission frequencyproportional to an on-chip system bus transmission frequency andautomatically adjusting the transmission frequency in response to achange in bus transmission frequency.

According to another aspect of the inventions, an integrated circuitdevice is provided, the circuit comprising a first interface forcommunicating debugging information to an external device, a secondinterface for communicating debugging information to the externaldevice, means for selecting at least one of first and second interfaces;and means for translating request from a system bus associated with theintegrated circuit to at least one of the first and second interfaces.

According to another aspect, an integrated circuit is providedcomprising an interface for communicating information to an externaldevice and having an output buffer configured to store a plurality ofdata bits representing an output data message, the interface providingan indication to the external device that a data message is available tobe transmitted to the external device.

According to another aspect of the invention, a data shift register isprovided which is adapted to communicate message information. The shiftregister comprises a plurality of stored locations; and means forshifting a plurality of status bits, at least one of which indicatingwhether an output message stored in said storage locations is availableto be transmitted, wherein said means shifts only the status bits out ofthe data shift register.

According to another aspect, an integrated circuit is providedcomprising a communication circuit having a communication link couplingthe integrated circuit and an external system, wherein the communicationcircuit is configured to transmit at least one of a group of messagesincluding a request message including a system bus command for accessinga location in a memory of the external system; a response messageincluding data produced in response to said system bus command; and atrace message.

Further features and advantages of the present invention as well as thestructure and operation of various embodiments of the present inventionare described in detail below with reference to the accompanyingdrawings. In the drawings, like reference numerals indicate like orfunctionally similar elements. Additionally, the left-most one or twodigits of a reference numeral identifies the drawing in which thereference numeral first appears.

BRIEF DESCRIPTION OF THE DRAWINGS

This invention is pointed out with particularity in the appended claims.The above and further advantages of this invention may be betterunderstood by referring to the following description when taken inconjunction with the accompanying drawings in which similar referencenumbers indicate the same or similar elements.

In the drawings,

FIG. 1 is a block diagram of an integrated circuit in accordance withone embodiment of the invention;

FIG. 2 is a detailed block diagram of an integrated circuit inaccordance with one embodiment of the invention;

FIG. 3 shows a system for transferring information to an externalsystem;

FIG. 4 shows data formats of request and response messages sent by anexternal system;

FIG. 5 shows data formats of request, response, and trace messages sentby an integrated circuit;

FIG. 6 shows one embodiment of an interface between a debug circuit andan external system;

FIG. 7 is a timing diagram showing an output protocol in accordance withone embodiment of the invention;

FIG. 8 is timing diagram showing an input protocol in accordance withone embodiment of the invention;

FIG. 9 shows one embodiment of a JTAG interface in accordance with oneembodiment of the invention;

FIG. 10 is a block diagram of a standard JTAG processor;

FIG. 11 is a state diagram showing operation of a standard JTAG TestAccess Port (TAP) controller;

FIG. 12 is a block diagram of a JTAG debug register in accordance withone embodiment of the invention;

FIGS. 13A and 13B show a data shift of data transmitted and received,respectively, by the JTAG debug register shown in FIG. 12;

FIG. 14 is a circuit block diagram showing two interfaces of anintegrated circuit;

FIG. 15 is a timing diagram showing resetting of a processor by applyingan external signal; and

FIG. 16 is a timing diagram showing resetting of a processor by writingto a register.

DETAILED DESCRIPTION

One embodiment of the invention is described with particularity withrespect to FIG. 1. FIG. 1 shows a block diagram of an integrated circuitdevice 101, or system-on-chip (SOC) mentioned above. This circuit mayinclude a processor 102 and debug circuit 103 interconnected by a systembus 105. System bus may be a conventional bus, packet switch, or othercommunication medium used to communicate operating information betweenmodules of device 101. Operations such as reads, writes, swaps, and thelike are typical operations that are performed between modules. Otheroperations may also be performed.

Processor 102 is a device which is adapted to read and execute programcode including one or more processor instructions, and to performoperations on data. Processor 102 may read data from a number of datasources, and write data to one or more data stores (not shown). Thesedata stores may include Random Access Memory (RAM), a computer hard discaccessible through a hard disc controller, storage accessible over oneor more communication links, or any entity configured to store data.These storage entities may be accessible directly on system bus 105 ormay be accessible through an external communication link 107. Processor102 may be a general purpose processor, such as a processor running in ageneral purpose computer system or may be a specialized processoradapted for a special purpose. It should be understood that any type ofprocessor and any number of processors may be used.

In one embodiment of the invention, a communication link 104 couplesprocessor 102 to debug circuit 103, and is separate from system bus 105.Link 104 is configured to transfer debug information from processor 102to debug circuit 103, and to transfer state and processor controlinformation from the debug circuit 103 to processor 102. It should beunderstood that one or more processors may be serviced by debug circuit103, and may be connected by one or more links 104 or through one ormore system busses 105.

In one aspect of the invention, trace information is received by debugcircuit 103, where it is processed and stored or transmitted to anexternal system 106 through one or more communication links 107. Theterms link and interface are used as equivalent terms and shall be usedinterchangeably hereinafter.

In accordance with another embodiment of the invention, traceinformation is compressed prior to transmitting the trace informationoff-chip. In particular, instruction address, operand addresses, andtimestamp information may be compressed to save storage space, and toreduce an amount of bandwidth needed to transfer the trace informationto an external system 106. According to another embodiment, traceinformation is stored on-chip and/or in a memory associated withintegrated circuit 101. By compressing trace information prior tostoring it, use of on-chip storage and/or system memory is minimized.

In another aspect, communication link 107 may be used to transfer systembus transactions to and from external system 106. For example, thesystem bus transactions may include read, write, and swap transactionsthat are used to perform operations between addressable modules locatedon system bus 105. Other bus transactions may be used. A communicationinterface of debug circuit 103 attached to link 107 may bememory-mapped, such that on-chip devices may perform system bustransactions to external system 106. Because on-chip devices can accessexternal system 106 in this manner, software code may be stored inexternal system 106 and executed by processor 102 over link 108.Similarly, external device communication link 107 may also initiatesystem bus transactions to effect operations on on-chip devices othermodules coupled to system bus 105. According to one aspect of theinvention, a plurality of addressable modules such as processors areconfigured to operate on the system bus, and communication link 107allows external system 106 to access these addressable modules.

Link 107 may include separate input and output interfaces which providecommunication with an external system 106. The links 107 may be any typeof medium, width or transmission speed. For example, link 107 may alsohave an input data path 1-bit wide and an output data path 4-bits wide.The widths of the input and output data paths may be increased to meetthe debugging bandwidth needs of different implementations andapplications.

According to various embodiments of the invention, link 107 provides:

Access by the external system 106 to the processor physical address map(RAM, ROM, on-chip devices, external-devices).

Processor-originated access to an address space mapped over the link 107into external system 106 memory. This allows debugging software such asa target debug agent (or any other software code) to be executed on theprocessor 102 without requiring any external RAM or ROM, and thusenables use of processor 102 without a traditional monitor ROM used tohold on-chip debug software.

Control of the processor 102 via one or more memory-mapped registers.

Streaming operations for processor 102 and bus trace information tosupport non-intrusive trace functions. Debug circuit gathers informationfrom the processor 102 and the on-chip busses to be copied to aspecified address area in the physical memory map, such as memoryassociated with integrated circuit 101 (such as a RAM) or link 107. Link107 is normally connected to an interface in an adapter device ofexternal system 106 to provide code download and debug facilities.Interface 107 can also be connected to specialized hardware debugsystems such as logic analyzers to provide more complex functionsincluding triggering.

Link 107 may operate using two protocol levels to communicate to anexternal device 106:

A low-level protocol which provides start-of-message indication,end-of-message indication and flow control. At this protocol level,message input and message output can be independent such that messagescan flow in both directions at the same time.

A higher-level messaging protocol which identifies the message contentsand specifies the response required to each request. Certain messagetypes, such as trace messages from processor 102 may be output-only andthus require no response from external system 106. It should beunderstood that one or more protocols may be used to implement thefeatures described herein, and the invention is not limited to theparticular implementations disclosed.

FIG. 2 shows a more detailed diagram of a system according to oneembodiment of the present invention. Integrated circuit 101 includes aprocessor 102, a bus analyzer 201, and a debug circuit interconnected bysystem bus 105. Bus analyzer 201 provides analysis of bus transactionsoccurring on system bus 105, and provides control signals and traceinformation to debug circuit 103. It should be understood that any typeof circuit could be used that provides information to be transmitted toexternal system 106. Integrated circuit 101 may also have one or morecommunications links 208A, 208B to external system 106.

Debug circuit 103 may receive trace and/or state information fromprocessor 102 and bus analyzer 201 and may include a trace processor 202which receives the trace and/or state information and formats tracemessages and stores them in trace storage unit 205. Trace processor 202may be, for example, a circuit, processor, or software process that canreceive information and generate trace messages. Trace storage 205 mayalso include a FIFO buffer for receiving trace messages. A trace systemmay be used such as one or more of the trace systems described in theU.S. patent application Ser. No. 09/410,558 entitled APPARATUS ANDMETHOD FOR STORING TRACE INFORMATION by D. Edwards et al., filed Oct. 1,1999, and incorporated herein by reference in its entirety.

Trace messages may be stored in a memory associated with integratedcircuit 101 by memory access circuit 203. Memory access circuit 203 mayutilize a bus interface 204 which sends system bus messages 105 to amemory associated with integrated circuit 101. Bus interface 204 mayperform bus transactions such as reads, writes, and swaps to addresseswithin an address space of an addressable device located through systembus 105, such as an address of a memory location in a memory device. Itshould understood that bus interface 204 may access any deviceassociated with integrated circuit 101, including additional processors,or other devices, and may perform other types of bus transactions.

Debug circuit 103 may include a communications processor 206 thatcontrols communication to external system 106 and provides access to anaddress space of external system 106 through bus interface 204. That is,devices such as processor 102 may initiate bus transactions over systembus 105 to an address in an address space mapped to external system 106.Communications processor 206 may receive requests from bus interface204, and generate responses to a device located on the system busthrough bus interface 204.

Communications processor 206 may also provide the ability toautomatically choose a transmission interface 208A, or 208B or may becontrolled by external system 106 to choose one or more of theinterfaces 208. For example, selection of an interface by externalsystem 106 may be performed by writing a value to a register 209 incircuit 103. According to one embodiment, when register 209 contains acommand indicating the use of JTAG interface 208B, interface 208A isdeactivated and interface 208B is used to receive and transmit messages.

As discussed above, debug circuit 103 may include a JTAG interface 208Bthat is configured to communicate trace and bus transaction informationbetween debug circuit 103 and external system 106. To facilitate atransfer of information over the JTAG interface 208B, circuit 103 mayinclude a JTAG processor 207 that controls JTAG interface 208B andcommunication of data to external system 106.

FIG. 3 shows a more detailed diagram of a circuit 300 in accordance withone embodiment of the invention. An integrated circuit may include a businterface 204 that functions as both a bus slave 307 and a bus master308. That is, bus interface 204 may be capable of initiating andcontrolling a communication on a bus. Bus slave 307 is a bus device thatcan only act as a receiver of requests received on bus 105. Businterface 204 may communicate using a bus protocol, which is a set ofrules which define bus signals asserted by master and slave devices ineach phase of a bus operation. Bus protocols are well known in the art,and it should be understood that the invention may be utilized with anytype of bus or any other type of integrated circuit communicationmechanism.

Communications processor 206 may include a transmit processor 301 whichis responsible for receiving trace information stored in trace storage205 for transmission to external system 106. Trace information isgenerally formatted as discrete trace messages transmitted to externalsystem 106. Trace messages include one or more states of processor 301,such as program counter information and the like. Also, trace messagesare typically unsolicited messages sent to external system 106, and aresent when a particular condition occurs within processor 102 or anyother device associated with integrated circuit 101. In particular,transmit processor 301 may transmit requests received from bus slave 307to debug link circuit 303, and these requests may be transmitted toexternal system 106.

Communication processor 206 also includes a receive processor 302 whichreceives information from a debug link circuit 303. According to oneembodiment of the invention, transmit processor 301 and receiveprocessor 302 operate independently. That is, there is no interactionbetween processor 301 and processor 302 to coordinate the transmissionand reception of messages.

Debug link circuit 303 may provide a high speed interface 309 whichincludes separate transmit and receive paths 309A and 309B,respectively. According to one embodiment, transmit path 309A allowshigh-bandwidth data to pass to interface hardware 305 of external system106. For example, path 309A may be a 4-bit wide path that is capable oftransmitting data at a comparable speed to a frequency of a system bus,such as 1 Mbit/second and higher. According to one embodiment, transmitpath 309A has a data transmission rate of 100 Mbit/s.

Path 309B may also be used to transfer information from external system106 to debug link circuit 303. Such information may include responsesfrom external system 106. As discussed above, system 106 may alsoinclude a JTAG interface 306 that conforms to IEEE standard 1149.1-1990.Integrated circuit 101 includes a JTAG processor 207 that communicatesinformation such as system bus transactions and trace information overintegrated circuit boundary 304 to a JTAG interface 306 in system 106.

Debug circuit 103 may initiate two types of transactions over externallink 107; bus transactions and transmission of trace messages. Messagesassociated with bus transactions are referred to as bus messages,hereinafter referred to as DBUS messages. These DBUS messages aretypically transmitted when an external system 106 reads or writes to anaddress space of integrated circuit 101, and when the integrated circuit101 or other bus master on system bus 105 reads or writes to an addressspace in external system 106. Also, another type of transaction includestransmitting trace messages from debug circuit 103 (these messages arehereinafter referred to as DTRC messages) to external system 106.According to one embodiment of the invention, the protocol whichtransmits these transaction messages is the same, regardless of thewidth of the data path in link 107 or the type of data paths used.

A DBUS message is sent from integrated circuit 101 whenever theprocessor 102 or other bus master issues requests to a debug circuit 103target address space. For each request message sent from integratedcircuit 101, there is a corresponding response message sent back fromthe external system 106. According to one embodiment, the DBUS requestmessage has the same format as a system bus message, but includes aheader to identify it as a DBUS message.

A DBUS request message 401 may be defined that supports the followingcommands:

load command (read from a memory address);

store command (write to memory address);

swap command (write to a memory address and return a previous valuewhich is stored at the memory address); and other commands, such ascache coherency commands that may be available. It should be understoodthat any commands may be implemented.

As shown in FIG. 4, a DBUS request message 401 may have a number offields. Request opcode 402 may include data which defines the contentsof the message 401. For example, request opcode 402 may includeinformation which identifies whether the transaction is a bus request ora bus response message. Address 403 may be, for example, an address ofan addressable range of a device on system bus 105. In one aspect of theinvention, a portion of address field 403 may identify a destinationsystem bus 105 device. In the remainder of the address field, sourcefield 404 identifies the source of the request. When generating aresponse, a system may ensure that the value in the source field of theresponse matches the source field of the original request. Message 401may also include a transaction identifier (TID) field 405 thatidentifies the transaction. Mask 406 may define data which issignificant within a particular word of data. In one embodiment, field406 may have no meaning for transactions with multiple words. Data field407 contains the actual data that will be written to a memory locationdefined by address 403.

External system 106 may also generate a response message 408 in responseto a received request message 401, and response message 408 may alsoinclude a number of data fields. For example, response message 408 mayinclude response opcode 409 that identifies message 408 as a responsemessage. Message 408 may also include one or more dummy fields 410, 413which contains no useful information but is provided such that DBUSrequests and responses have the same field structure and size. Dummyfields 410, 413 are not required, but may be used to provide anequivalent message structure for request and response packets, and thuson-chip hardware may be simplified. Message 408 may include source 411and transaction identifier 412 fields similar in function to the fieldsof message 401. Further, response message 408 may not require a maskfield 406 in the response (a mask is applied to data of a requestmessage), therefore a dummy field 413 can be inserted. Response message408 may include data 414 which may be data that was stored at a memorylocation defined by address 403.

FIG. 5 shows request 501, response 509, and trace 517 messages that maybe transmitted by a debug circuit 103 to external system 106. Requestmessage 501 may include a message type field 502, request opcode 503,address 504, source 505, TID 506, mask 507, and data 508 fields whichare similar in format and function to similarly-named fields of requestmessage 401. Further, debug circuit 103 may be configured to send aresponse message 509 to an external system 106, response message 509including message type 510, response opcode 511, dummy 512, source 513,TID 514, dummy 515, and data 516 fields similar in form and function tosimilarly-named fields of response message 408. Additionally, debugcircuit may be configured to transmit trace messages 517 (DTRC messages)having state information associated with processor 102. In oneembodiment, there may be two types of DTRC messages:

trigger trace messages indicating that external system 106 shouldperform one or more actions based on receiving the trigger tracemessage; and

background trace messages which are information-only trace messages.

These different types of trace messages may be distinguished by amessage type field 518, and may contain similar format of traceinformation data 519. For example, a trigger trace message maycorrespond to a value of the message type field 518==0b011 andbackground trace messages may correspond to a value of the message typefield 518==0b010. Trace messages 517 may also be transmitted outwardlyonly from debug circuit 103 and require no response from external system106.

As discussed above, trace information may include state information ofprocessor 102. For example, a watchpoint channel may be defined inprocessor 102 that “watches” for a particular state condition inprocessor 102 and triggers an event signal to debug circuit 103 when thecondition occurs. A watchpoint channel may include a mechanism by whicha data value associated with an execution pipeline in processor 102 maybe matched to one or more predetermined data values. For example,predetermined data values stored in registers associated with processor102 may be compared with data values in processor 102 includinginstruction addresses, instruction value addresses, operand addresses,performance counters, event counters, and the like.

When matched, a controller associated with the watchpoint channel mayprovide an event signal to debug circuit 103 through communication link104. The signal may take the form of state bits indicating particularwatchpoint channel states within processor 102. Also, state bit valuescorresponding to watchpoint channels may be combined together to produceother state bit values to be used in different debugging operations bydebug circuit 103, and these other state bit values may also becommunicated to debug circuit 103.

In a similar manner, debug circuit 103 may provide a number of statevalues to processor 102 for use in debugging operations. In particular,debug circuit 103 may provide a number of bit values that operate aspreconditions for watchpoint channels to trigger particular watchpointchannel events in processor 102. These watchpoint channel events mayprovide information to be included in a trace message, or may determinea type of trace message generated.

Further, other modules associated with debug circuit 103 may includewatchpoint channels and may generate state information to be included intrace messages. For example, a circuit operatively connected to thesystem bus, referred to as a bus analyzer, may analyze bus transactionsby comparing values stored in registers associated with the bus analyzerto request and response messages, and may provide state information orcontrol signals to one or more modules. These and other features ofwatchpoint channels are described more fully in the co-pending U.S.patent application Ser. No. 09/410,607 entitled MICROCOMPUTER DEBUGARCHITECTURE AND METHOD, by D. Edwards, et al., filed Oct. 1, 1999,incorporated by reference in its entirety.

Debug circuit 103 may transmit trace messages in accordance with a tracemessage format. Table 1 below shows an example format of a general tracemessage.

TABLE 1 General Trace Message Fields Header Bit Field Size PositionsDescription Message 3-bits [0, 2] Defines the basic contents of the de-Type bug message field values of 0b010 (DTRC background trace message)and 0b011 (DTRC trigger trace message) indicate the type of tracemessage. Source 3-bits [3, 5] Defines the on-chip source module Modulewhich provides the information in the trace message. Value - Description0 - Processor watchpoint controller 1 - Bus Analyzer 2-7 - Reserved forwatchpoint logic in additional processor cores or future acceleratormodules. Event Type 5-bits  [6, 10] Defines a watchpoint channel in thesource module which generated the trace message. Values may identifywatchpoint channels in the processor and Bus Analyzer. Over Stall 1-bit[11] This bit may have two meanings depending on whether the stall-moderegister identifies a stall mode or a non-stall mode. In stall mode,this bit is set when processor 102 was stalled for some indeterminatetime prior to this trace message being generated because there was nospace available in the trace storage unit 205 of the debug circuit. Innon-stall mode, this bit is set to indicate that one or more tracemessages before this one were dis- carded because there was no spaceavailable in trace storage 205. That is, in non-stall mode, this bitindi- cates that one or more trace messages were lost. PC Absolute1-bits [12] Defines whether a program counter (PC) field contains a4-byte absolute address or a 1- or 2-byte relative address. A relativeaddress is the signed offset from the most recent PC value sent in aprevious trace message (of any type). Value - Description 0 - Relativeaddress offset 1 - Absolute 4-byte address Other 4-bits [13, 15]Specific for each watchpoint channel type. Timestamp 1-byte N/A Thisoptional field may occur in the trace message when, for example, thewatchpoint channel's action includes enable_trace_timestamp == 1. Thisvalue may be, for example, a one-byte value that specifies a number oftimer increments since the last Reference trace message was generated.ASID 1-byte N/A This optional field may occur, for example, whenever thewatchpoint channel if setup to match any ASID (address space identifier)that identifies a particular process exe- cuting on processor 102. When,for example, a watchpoint channel's pre-condition includes asid_enable== 1, then the ASID field does not appear in the trace messages. PC 1, 2or N/A If the value of PC Absolute is ‘0’, 4 bytes this field is a1-byte or 2-byte com- pressed address as a signed offset from the mostrecent program counter value sent in a previous trace message (of anytype). If the value of PC Absolute is ‘1’, this field holds 4-byteabsolute value of the program counter.

Trace messages specific to a watchpoint channel type may be generated.For example, specific trace messages may be generated indicating aparticular occurrence in processor 102, such as states triggeringwatchpoint channels. A patent application Ser. No. 09/410,558 entitledAPPARATUS AND METHOD FOR STORING TRACE INFORMATION, by D. Edwards etal., filed Oct. 1, 1999, herein incorporated by reference, describesvarious formats of trace messages associated with different watchpointchannel types. It should be understood that any trace message format maybe used and any status information may be communicated in tracemessages.

FIG. 6 shows one embodiment of an interface 208A in accordance with oneaspect of the invention. As shown, link 208A may include signals foroutput, input, and reset/power management of integrated circuit 101. Inparticular, debug circuit 103 of integrated circuit 101 may includeoutput logic 611 which handles transmission of signals to input logic614 of external system 106, such as those signals associated withtransmitting data at integrated circuit 101. Debug circuit 103 may alsoinclude input logic 612 which accepts signals from output logic 615 ofexternal system 106 such as those signals associated with receiving dataat integrated circuit 101. Debug circuit 103 may also includereset/power management logic 613 that provides and accepts signals fromreset power management 616.

In particular, debug circuit 103 may provide a number of signals toexternal system 106 across integrated circuit boundary 601. For example,circuit 103 may include a signal dm_out 603 which transmits an outputdata value from circuit 103. In one embodiment, dm_out 603 may be a4-bit wide output path. The value of data on these pins may besynchronous to the rising edge of an output clock signal dm_clkout 602.The data value on these pins may also be valid whenever an outputsynchronization signal dm_osync 604 is low, apart from the first 4-bitsof the output message, which are valid just prior to the falling edge ondm_osync (i.e., when it is high). Signal dm osync 604 may be a 1-bitoutput from circuit 103 that indicates to external when data is beingtransmitted, synchronous to the rising edge of dm_clkout 602. When high,signal 604 indicates either an output idle condition or the start of anoutput message transfer (i.e., transfer of the first 4-bits of themessage). When low, dm osync 604 indicates the body of the messagesbeing transferred (i.e., a falling edge indicates that dm_out 603 on theprevious rising edge of dm_clkout was the first 4-bits of the outputmessage).

Signal dm_clkout 602 may be a clock signal generated internally withinintegrated circuit 101 received by system 106 and used to clock receiveddata signal dm_out 603. Valid dm_clkout 602 frequencies may, forexample, range from DC to values including 100 MHz or more, depending onthe configuration of programmable divider circuit 309.

STATUS0/STATUS1 signals 608 are used to indicate a power status of theintegrated circuit such as being in normal operation, standby mode,sleep mode, or performing a scan-reset. These different states arediscussed in detail below with respect to FIGS. 14-16. To interact withintegrated circuit 101, external system 106 may monitor theSTATUS0/STATUS1 608 signals when performing read or write operations tointerface 208A.

Interface 208A provides a number of input signals received from externalsystem 106. Signal dm_in 606 may carry input data from external system106 to integrated circuit 101. For example, signal dm_in 606 may be a 1-bit wide input from system 106 to circuit 103, and synchronous to arising edge on an input clocking signal dm_clkin 605, which may be aclock signal generated within system 106. According to one embodiment ofthe invention, valid input clocking frequencies range from DC to 100 MHzand above. In one aspect, signal dm_clkin 605 is derived from outputclocking signal dm_clkout 602 such that the state of an input buffer ofdebug circuit 103 during output idle periods is synchronized with inputmessage operations. However, if software utilizing the physicalinterface only allows one DBUS transaction to an external system to beoutstanding at once, it may be beneficial for dm_clkin signal 605 to notbe related to signal dm_clkout 602 such that message transmission andreception is more efficient, because the input and output clocks are notlinked. Also, hardware complexity of transmit and receive circuits ofdebug circuit 103 may be tailored specifically for the application, ifinput and output clocks are independent.

Signal {overscore (RESETP)} is used by external system 106 to cause aPOWERON reset that is a reset initiated when integrated circuit ispowered on and no register state is saved. Signal {overscore (RESETM)}610 is used to cause a MANUAL reset whereby integrated circuit 101 isreinitialized, and one or more control registers have saved state.

It may be possible for debug circuit 103 to re-establish a connectionbetween itself and external system 106 if link 208A is unavailable. Link208A may be unavailable due to the link being temporarily disconnected,electrical noise, or some other reason. In particular, debug circuit 103(or external system 106) may monitor signals of the link to determinethat the link is unavailable. For example, if the link is broken, anexternal system 106 such as a debug tool may detect the dm_clkout 602frequency go to a DC value, but external system 106 will not detect anoperating mode of the integrated circuit 101 (such as a standby state)on signal lines for the STATUS0/STATUS1 608 signal. When the link 208Ais re-established, external system 106 may resynchronize to a messageboundary by monitoring a synchronization signal, such as dm_osync 604,to detect a start of message or an idle period. For example, if externalsystem 106 detects a transition of signal dm_osync 604 with the value ofdm_out==obX000, a start of an idle period has been detected, andexternal system 106 is now synchronized. In a similar manner, integratedcircuit 101 may resynchronize using synchronization signal dm_isync 607.

Table 2 below shows signals of debug link 208A according to oneembodiment of the invention:

TABLE 2 Debug Link Signals Internal Signal Lines Source Pull-upDescription dm_clkout 1 IC No Debug link clock from IC. (IntegratedInactive when Debug Module Circuit) is not enabled, during a resetsequence and in standby state. dm_out[0,n] 4 or 8 IC No Output data.dm_osync 1 IC No Output sync. dm_clkin 1 External Yes Clock fromexternal system, system in phase with dm_in and dm_sync. Also DebugModule enable/disable control sampled at the end of a power-on or manualreset sequence. dm_in 1 External Yes Input data. Also reset mode systemsignal sampled at the time either {overscore (RESETP)} or {overscore(RESETM)} is pulsed low. dm_isync 1 External Yes Input sync. Alsoprocessor system suspend mode sampled at the end of a power-on or manualreset sequence. For example, a value of 0 may indicate that processor103 remains suspended following a reset. If the value is 1, theprocessor operates normally after reset. STATUS0/ 2 IC No Processorstate. STATUS1 {overscore (RESET)} 1 External No Board-level resetsignal. This system or can be connected to either the IC {overscore(RESETP)} pin or the {overscore (RESETM)} pin of the IC. For certaintarget boards, this signal may also be asserted when a reset button onthe target board is pressed, allowing the external system to monitorsuch occurrences.

Integrated circuit 101 may also include a programmable circuit 309 whichprovides clocking information for debug link circuit 303. Programmabledivider circuit 309 may accept an input clock 310 which may be aninternal bus frequency of system bus 105. Programmable divider circuit309 may access one or more registers 209 to determine the amount bywhich the input clock 310 will be divided. For example, register 209 maybe a 16-bit value. Register 209 may also be programmable by integratedcircuit 101 or an external system 106 in order to change thetransmission frequency of debug circuit 103. Output logic 611 may usethe clocking information as the dm_clkout signal 602 for use by externalsystem 106 for receiving data.

Message protocols may be used over both a high-performance interface208A, and a JTAG interface 208B in accordance with the IEEE 1149.1standard. The message protocol involves sending bus messages and tracemessages over one or more links 208. According to one embodiment of theinvention, the message protocol used to communicate over JTAG interface208B is the same protocol used over interface 208A. In one embodiment,the JTAG interface 208B is operable when selected by a circuit of thedebug circuit 103, such as when a high-performance link 208A isunavailable. In another embodiment, the JTAG interface 208B is selectedby writing a value to a register in the debug circuit, the valueindicating that messages should be transmitted over interface 208A. Byusing standard JTAG components and protocols, existing JTAG componentscan be reused in external system 106.

FIG. 7 shows a timing diagram of an output message protocol inaccordance with one embodiment of the present invention. Signal A 701indicates an output-idle state wherein output-idle words are transmittedover the link 208A during times when the debug circuit has not data tosend, for example, when a trace buffer is empty. When trace processor202 produces trace messages which are stored in trace storage 205, theymay be sent over link 208A with an idle word separating different tracemessages.

Output-idle words may serve another purpose; they may provide anindication to an external system 106 that debug circuit 103 may becapable of receiving a DBUS request message. In particular, theoutput-idle word may include a bit which indicates a status of a receivebuffer located in debug circuit 103. For example, the bit may indicatethat the receive buffer is empty, and that a message may be transmittedfrom system 106. Alternatively, the bit may indicate that the receivebuffer is full, and a message should not be transmitted by system 106.According to one embodiment of the invention, trace messages (DTRC) aretransmitted by debug circuit 103 to external system 106 without regardto flow control information. Thus, DTRC messages can be discarded if areceive buffer of external system 106 cannot receive additional tracemessages. If DBUS request messages are discarded, an associated DBUSresponse will not be generated, and an error will occur.

As shown in FIG. 7, signal A 701 may correspond to an output-idle state,with a value of dm_out [0,2]==0b000, and dm_out [3]==debug circuitreceiver buffer busy (1) or empty (0). Signal B 702 may be a start ofmessage indication, with dm_out [0,2] equaling the message type. SignalC 703 indicates transmission of message data such as a DBUS request orDTRC message.

FIG. 8 shows a timing diagram associated with an input message protocolof a debug circuit 103. Signal A 801 indicates an input-idle state,whereby dm_in==0 (debug adapter DBUS receive queue ready), and a valuedm_in==1 (debug adapter DBUS receive queue busy). Signal B 802 providesmessage data such as a DBUS response. Because trace messages are nottransmitted from an external system 106 to debug circuit 103, headerinformation is not required in message data 802.

According to one embodiment, signal dm_isync 607 is used to distinguishmessage data on the dm_in pin 606 from line idle. A transition fromdm_isync==1 to dm_isync==0 indicates a start of a message and atransition from dm_isync==0 to dm_isync 1 indicates the end of themessage. Messages may be separated by one or more clock periods of idle(dm_isync==1).

Tables 3 and 4 below, show examples of a DTRC message and a DBUSmessages, respectively, transmitted over debug link 208A:

TABLE 3 Trace Message (DTRC) Example Clock dm_osync Cycle statedm_out[0,3] contents −1 1 Output-Idle [0,2] = 0b000 (MHDR_IDLE) [3]buffer status 0 1 Header [0,3] [0,2] == 0b010/0b011 (MHDR_DTRC_{BACK/TRIG}) [3] == bit 3 of trace header 1 0 Header [4, 7] 2 0 Header[8, 11]3 0 Header [12, 15] 4 0 Program Counter (PC) Value [0, 3] 5 0 PC Value[4, 7] 6 0 PC Value [8, 11] 7 0 PC Value [12, 15] 8 0 PC Value [16, 19]9 0 PC Value [20, 23] 10 0 PC Value [24, 27] 11 0 PC Value [28, 31] 12 1Output-Idle [0,2] = 0b000 (MHDR_IDLE) [3] = buffer status

TABLE 4 DBUS Read Request Message Example Clock dm_osync Cycle statedm_out[0, 3] contents −1 1 Output-Idle [0,2] == 0b000 (MHDR_IDLE), [3]== buffer status 0 1 Header [0,3] [0,2] == 0b001 (MHDR_DBUS) [3] = nouseful data 1 0 Dummy nibble (no useful data) 2 0 Opcode [0,3] 3 0Opcode [4,7] 4 0 Address [0,3] 5 0 Address [4,7] 6 0 Address [8,11] 7 0Address [12,15] 8 0 Address [16,19] 9 0 Address [20,23] 10 0 Address[24,27] 11 0 Address [28,31] 12 0 Source [0,3] 13 0 Source [4,7] 14 0TID [0,3] 15 0 TID [4,7] 16 0 Mask [0,3] 17 0 Mask [4,7] 18 1Output-idle [0,2] = 0b000 (MHDR_IDLE) [3] = buffer status

FIG. 9 shows a JTAG interface 208B that connects an external system 106to an integrated circuit 101. Link 208B includes a number of signals,and according to one embodiment, these signals are in accordance withthe IEEE standard and one or more signals associated with powermanagement. Signal TCK 901 provided from external system 106 is anexternal clock signal used for clocking data received from system 106.Signal TCK is a test clock which controls the timing of JTAG interface208B, and is generally independent of system clocks. Signal TMSindicates a test mode select which controls the operation of a JTAGstate machine (discussed below). Signal TDI 903 is serial data receivedfrom external system 106 and is generally synchronous with signal TCK901. Signal TDO 904 is data transmitted from integrated circuit 101.Signal TDO generally carries data to a boundary scan or instructionregister discussed below with reference to FIG. 10. Signal TDO istypically synchronous with signal TCK 901. Signal {overscore (TRST)} 905received from system 106 is a reset signal. In one embodiment,integrated circuit 101 includes a JTAG processor 207 which furtherincludes a TAP controller, the TAP controller operating according to afinite state machine. Operation of the TAP controller and finite statemachine will be discussed further below with reference to FIGS. 10 and11. The TAP controller finite state machine is reset by the {overscore(TRST)} signal 905 going low. Signal {overscore (TRST)} 905 is used toinitialize the JTAG interface 208B when the signal 905 is deasserted.Signal {overscore (TRST)} is generally asynchronous to signal TCK 901.

Additional signals may be included, such as a {overscore (RESET)} signalthat is a bi-directional signal whereby external system 106 may monitorthe signal to detect when board-level reset is initiated. SUSPEND signal907 determines a processor mode following a reset. A suspending of aprocessor may include stopping the processor from executinginstructions. A processor may be stalled, for example, by stalling aninstruction fetch unit or circuit of the processor, preventing theprocessor from fetching new instructions to be executed. For example, aprocessor may remain suspended following a reset, or may operatenormally. System 106 also provides a RESET_MODE signal 908 that mayforce a debug reset POWERON reset or MANUAL reset. Signal dm_enable 909is transmitted by system 106 to determine the debug module statefollowing a reset. For example, the debug circuit 103 may be enabledfollowing reset, or disabled with its clock source turned off followingreset.

Table 5 below shows signals of a JTAG link in accordance with oneembodiment of the invention:

TABLE 5 JTAG Debug Link Signals Signal Source Description TCK FromExternal JTAG clock system TDI From External JTAG data in system TDOFrom IC JTAG data out TMS From External JTAG test mode select system{overscore (TRST)} From External JTAG interface reset. The TAP con-system troller finite state machine is reset by TRST going low. This pinmay have no effect on other chip functions. {overscore (RESET)}Bi-directional External system can monitor this signal to detect whenboard-level reset is initiated. SUSPEND From External Processor suspendmode following system reset. Value - Description 0 - Processor remainssuspended following reset 1 - Processor operates normally followingreset RESET_MODE From External This signal is sampled at the time systemeither {overscore (RESETP)} or {overscore (RESETM)} is pulsed low andallows the tool to determine the type of reset function performed.Value - Description 0 - Forces a DEBUG reset regardless of whether the{overscore (RESETP)} pin or the {overscore (RESETM)} pin is asserted.1 - A normal POWERON reset or MANUAL reset is initiated when thecorresponding reset pin is asserted. DM_ENABLE From External DebugModule state following reset. system Value - Description 0 - The DebugModule is enabled following reset. 1 - The Debug Module is disabled withits clock source turned off following reset.

A JTAG link 208B may be used alternatively to link 208A to connect to adebug tool, however, the effective bandwidth (messages per second) istypically much lower than that of link 208A. Messages capable of beingsent over link 208A may also be sent via JTAG link 208B. In oneembodiment, a JTAG link 208B has the following characteristics:

Standard JTAG functionality is not compromised (e.g. the standard JTAGinstruction “space” is unchanged) and the JTAG port may also be used forconventional boundary scan testing.

JTAG port 208B may be accessed from standard JTAG state-machineinterface devices.

The JTAG port allows “unsolicited” messages to be sent from integratedcircuit 101 to the debug tool. Conventional use of JTAG ports only allowrequest/response type messages from an external system 106.

JTAG link 208B uses an identical message structure as link 208A.

The JTAG TAP controller implements all the mandatory features of astandard JTAG port, including the well-known mandatory JTAG instruction“BYPASS” and the optional instruction “IDCODE”. In one embodiment, aJTAG instruction register defaults to the “IDCODE” instruction.

The JTAG link may be used, for example, as a conventional boundary scanport, or an interface for transferring debug information. Access todebug features may be enabled, for example, by loading a command to aJTAG instruction register. At a POWERON state of integrated circuit 101,the debug circuit may default to select link 208A as the debuginterface, and enable JTAG interface 208B for normal boundary scanoperations. Debug circuit 103 may change its selection to JTAG interface208B when it detects that a command has been written into the JTAGinstruction register.

As discussed above, input and output debug messages transferred via JTAGport 208B may be identical to those which can be sent via link 208A. Asdiscussed above, the messages sent between integrated circuit 101 andexternal system 106 may be variable length messages. For example, alongest message may be 41-bytes (a DBUS 32-bit storage message requestfrom integrated circuit 101) and a shortest message of 3-bytes (aninstruction address or instruction value trace message). A JTAG debugmessage protocol defined herein provides a method for the integratedcircuit 101 and external system 106 to determine a start and end ofthese variable-length messages.

FIG. 10 shows an example of a JTAG processor 207 in accordance with oneembodiment of the invention. Boundary scan in accordance with oneembodiment of the invention allows either a boundary scan or debugoperations to be performed to an integrated circuit 101. Specifically,boundary scan is the application of scan data at the boundary of anintegrated circuit such that internal behavior of the integrated circuitmay be observed. Generally, boundary scan cells are interconnected toform a scan path between the IC's test data input (TDI) pin and testdata output (TDO) pin. During normal IC operations, input and outputsignals pass freely through each cell, from the normal device inputs1015 to the normal device outputs 1016. However, when the boundary-testmode is entered, the IC's boundary is controlled such that scan data isapplied to inputs and scan data results are collected from outputs.Specifically, the IC's boundary is controlled such that a test stimuluscan be shifted in and applied from each cell output and the testresponse can be captured at each cell input and shifted out forinspection.

FIG. 10 shows the IEEE standard 1149.1 architecture for a boundary scancircuit 1000. The architecture includes an instruction register 1002, abypass register 1010, optional user data registers 1009 specific to theintegrated circuit to be tested, and a test interface referred to as thetest access port or TAP. In FIG. 10, the boundary scan register 1004 isa serially accessed data register made up of a series of boundary scancells shown at the input and output boundary of internal logic of theintegrated circuit 1007.

The instruction register 1002 and test data registers 1003 are separatescan paths arranged between the primary test data input (TDI) pin ofJTAG interface 208B and primary test data output (TDO) pin of interface208B. This architecture allows the TAP controller state machine 1001 toselect and shift data through one of the two types of scan paths,instruction or data, without accessing the other scan path.

According to IEEE standard 1149.1, there are a number of required andoptional registers. Instruction register 1002 is a required registerwhich is responsible for providing address and control signals to accessa particular data register in the scan path. Instruction register 1002is accessed when the TAP controller state machine 1001 receives aninstruction register scan protocol. During an instruction register scanoperation, the select output from state machine 1001 selects the outputof the instruction register to drive the TDO pin 904.

The instruction register 1002 includes a shift register 1006 and aninstruction decode circuit 1005, which may be an instruction shadowlatch. The instruction shift register 1006 includes a series of shiftregister bits arranged to form a single scan path between the TDI 903pins and TDO 904 pins of the integrated circuit. During instructionregister scan operations, the TAP controller 1001 exerts control via aninstruction register shift enable signal (SHIFTIR 1203) and aninstruction register clock (CLOCKIR 1202) signals to cause theinstruction shift register 1006 to preload status information and shiftdata from TDI to TDO. Both the preload and shift operations occur on therising edge of TCK signal 901; however, the data shifted out from theintegrated circuit from TDO 904 occurs on the falling edge of signal TCK901.

Instruction decode circuit 1005 may include a series of latches, onelatch for each instruction shift register bit. During an instructionregister scan operation, the latches remain in their present state. Atthe end of the instruction register scan operation, the instructionregister update (UPDATEIR) input updates the latches with a newinstruction installed in the shift register 1006. When activated, the{overscore (TRST)} signal 905 sets the instruction decode circuit 1005to the value of the BYPASS instruction (or IDCODE instruction, ifsupported). This forces the device into its normal functional mode andselects the bypass register 1010 (or device identification register1008, if one is present).

IEEE standard 1149.1 requires two data registers; a boundary-scanregister 1004 and bypass register 1010, with a third optional, deviceidentification register 1008. Additional design-specific data registers1009 may also be included. The data registers 1003 are arranged inparallel from the primary TDI input to the primary TDO output. Theinstruction register 1002 supplies the address that allows one of thedata registers to be accessed during a data register scan operation.During a data register scan operation, the addressed scan registerreceives a TAP control via the data register shift enable (SHIFTDR 1203)and data register clock (CLOCKDR 1202) inputs to preload test responseand shift data from TDI to TDO. During a data register scan operation,the select output from state machine 1001 selects the output of the dataregister to drive the TDO pin 904. When one scan path in the dataregister is being accessed, all other scan paths remain in the presentstate.

The boundary-scan register 1004 includes a series of boundary-scan cellsarranged to form a scan path around the boundary of the internal logicof the integrated circuit 1007. The boundary scan cells are describedfurther with particularity in IEEE standard 1149.1-1990. At the end of adata register scan operation, the data register update (UPDATEDR) inputupdates the instruction decode latches with a new boundary test patternto be applied from the device outputs 1016 of the cells.

Bypass register 1010 includes a single scan register bit. When selected,the bypass register 1010 provides a single-bit scan path between TDI andTDO. Thus, the bypass register allows abbreviating the scan path throughdevices that are not involved in the test. The bypass register isselected when the instruction register 1002 is loaded with a pattern ofall ones to satisfy the IEEE standard 1149.1 BYPASS instructionrequirement.

Device identification register 1008 is an optional register, defined byIEEE standard 1149.1, to identify the device's manufacturer, partnumber, revision, and other device-specific information. The deviceidentification register may include a number of bit assignments definedfor the device identification register which can be scanned out of theregister 1008 after it has been selected. Although the deviceidentification register is optional, IEEE standard 1149.1 has dedicatedan instruction to select this register. The device identificationregister is selected when the instruction register 1002 is loaded withthe ID code instruction, the bit code of which is defined by the vendor.

IEEE standard 1149.1 defines nine test instructions, of which three arerequired and six are optional. Below, each required instruction isdiscussed briefly.

The BYPASS instruction is a required instruction which allows theintegrated circuit 101 to remain in a functional mode and selects thatbypass register 1010 to be connected between TDI and TDO. The bypassinstruction allows serial data to be transferred through the integratedcircuit 101 from TDI to TDO without affecting the operation of theintegrated circuit 101. The bit code of this instruction is defined asall ones by IEEE standard 1149.1-1990.

The SAMPLE/PRELOAD instruction is a required instruction which allowsthe integrated circuit 101 to remain in its functional mode and selectsthe boundary-scan register to be connected between TDI and TDO. Duringthis instruction, the boundary-scan register can be accessed via a datascan operation, to take a sample of the functional data entering andleaving the integrated circuit 101. This instruction is also used topreload test data into the data boundary-scan register 1004 beforeloading an EXTEST instruction. The bit code for this instruction isdefined by the vendor.

The required EXTEST instruction places the integrated circuit 101 intoan external boundary-test mode and selects the boundary-scan register1004 to be connected between TDI and TDO. During this instruction, theboundary-scan register 1004 is accessed to drive test data off-chip viaboundary outputs and receive test data off-chip via boundary inputs. Thebit code of this instruction is defined as all zeros by IEEE standard1149.1. Further, one or more of the optional instructions as defined byIEEE standard 1149.1 may be used.

Operation and use of JTAG interface 208B according to the IEEE standardmay be found in IEEE standard 1149.1-1990 (including IEEE standard1149.1A-1993), supplement to IEEE standard 1149.1-1990, IEEE standardtest access port and boundary-scan architecture, IEEE standard1149.1b-1994, all of which are incorporated by reference herein in theirentirety. Also, for further understanding of JTAG port operation, pleaserefer to the book entitled “The Boundary-Scan Handbook,” by Kenneth P.Parker, Kluwer Academic Publishers, Norwell, Massachusetts, 1992, hereinincorporated by reference in its entirety.

FIG. 11 shows a standard TAP controller state diagram in accordance withIEEE standard 1149.1-1990. The TAP controller finite state machine 1001shown in FIG. 10 is controlled by the test clock (TCK) and test modeselect (TMS) inputs. These two inputs determine whether an instructionregister scan or data register scan is performed. The TAP controllerincludes a small controller design, driven by the TCK input whichcorresponds to the TMS input as shown in the state diagram in FIG. 11.The IEEE standard 1149.1 test bus uses both clock edges of TCK. TMS andTDI are sampled on the rising edge of TCK, while TDO changes on thefalling edge of TCK. It is noted that in FIG. 11, the values shownadjacent to each state transition represents the signal present at TMSat the rising edge of TCK.

The main state diagram shown in FIG. 11 includes six steady states:Test-Logic-Reset, Run-Test/Idle, Shift-DR, Pause-DR, Shift-IR, andPause-IR. At POWERUP, or during normal operation of integrated circuit101, the TAP controller 1001 is forced into the Test-Logic-Reset stateby driving the TMS signal high and applying five or more TCKs. In thisstate, the TAP controller issues a reset signal that places all testlogic in a condition that does not impede normal operation of the hostIC. When test access is required, a protocol is applied via the TMS andTCK inputs, causing the tap to exit the Test-Logic-Reset state and movethrough the appropriate states. From the Run-Test/Idle state, aninstruction register scan or a data register scan can be issued totransition the TAP controller 1001 through the appropriate states asshown in FIG. 11.

The first action that occurs when either block is entered is a Captureoperation. The Capture-DR state is used to Capture (or parallel load)the data into the selected serial data path. In the instructionregister, the Capture-IR state is used to capture status informationinto the instruction register. From the Capture state, the TAPcontroller transitions to either the Shift or the Exit-1 state.Normally, the Shift state follows the Capture state so that test data ortest information can be shifted out for inspection and new data shiftedin. Following the Shift state, the TAP controller 1001 either returns tothe Run-Test/Idle state via Exit-1 and Update states or enters the Pausestate via Exit-1. From the Pause state, shifting can resume byre-entering the Shift state via the Exit-2 state or being terminated byentering the Run-Test/Idle state via the Exit-2 and Update states. Thus,a JTAG debug register 1201 may be used that shifts data in through TDIand out through TDO as shown in FIG. 11.

In one embodiment, there are two parts to the JTAG debug messageprotocol. At the lowest level, data and status bits are transferredbetween the external system and a serial data shift register 1006located in debug circuit 103. At a higher level, the protocol provides amechanism for detecting start and end messages including a variablenumber of bytes. As shown in FIG. 12, a data register 1009 such as JTAGdebug data register 1201 may be provided which is 74 bits long, thedebug data register including four valid input message (VIM) status bitsVIM 3, VIM 2, VIM 1, and VIM 0, one associated with each of four databyte positions, 32 data input bits, 32 data output bits, and inputbuffer full (IBF) status bit, and 4 valid output message (VOM) statusbits VOM 3, VOM 2, VOM 1, VOM 0, one associated with each of four databyte positions. Table 6 below shows one embodiment of status bits inaccordance with one embodiment of the invention.

TABLE 6 Status Bit Information Status Bit Description VIMx 0 − inputbyte position has no valid data 1 = the serial word which has just beenshifted in contains one byte of an input message in the correspondingbyte position VOMx 0 = output byte position has no valid data 1 = theserial word which has just been shifted out contains one byte of anoutput message in the corresponding byte position IBF 0 = the inputmessage buffer in the JTAG TAP controller 207 is available for a newmessage. 1 = the input message buffer in the JTAG TAP controller 207 isfull.

The following transfers may take place between JTAG debug register 1201and external system 106:

(1) The external system 106 can poll only the output status from JTAGdebug register 1201 (5 bits of the debug register 1201 are shifted).

(2) External system 106 can poll the output status plus data from 1-byteto 4-bytes of an additional message from the JTAG debug register 1201(13, 21, 29, or 37-bits of JTAG debug register 1201 are shifted).

(3) External system 106 can send status information and from 1-byte to4-bytes of an input message to JTAG debug register 1201 (13, 21, 29, or37-bits of JTAG debug register 1201 are shifted).

(4) External system 106 can poll status information and from 1-byte to4-bytes of an output message from the JTAG debug register andsimultaneously send status and from 1-byte to 4-bytes of an inputmessage to the JTAG debug register 1201 (13, 21, 29, or 37-bits of theJTAG debug register 1301 are shifted).

As shown in FIG. 13, when integrated circuit 101 is connected to anexternal system 106 capable of shifting variable length data words,external system 106 transfers 13, 21, 29, or 37-bits into the JTAG debugregister 1201 giving 8, 16, 24, or 32 message data bits and status bitsto indicate valid input data in each of the 4-byte positions (plus oneunused bit). When polling out an output message, external system 106shifts 13, 21, 29, or 37-bits out of the JTAG debug register 1201 withfour of these bits indicating valid output data in another status bitindicating the state of the JTAG TAP controller debug message inputbuffer (IBF).

To detect when integrated circuit has a pending output message and todetermine when the input buffer is available for a new input message,external system 106 polls the JTAG interface 208B at regular intervalsto shift out the IBF and VOMx status bits. In one embodiment of theinvention, the VOMx status bits are located closest to the TDO end ofthe shift register 1201. The external system 106 can therefore poll outthe VOMx and IBF status by shifting just 5-bits out of the shiftregister following the capture DR state. At the same time as these fivestatus bits are being shifted out of the shift register, the VIM statusbits may be shifted into the input end of the shift register from theTDI pin and is latched during the update-DR state. This simultaneousshifting is advantageous, since both input and output status may bedetermined within n clock cycles to read n status bits on both the inputand output paths. For example, when using five status bits, five clockcycles are needed. When the external system 106 has no pending inputmessage to send, and it simply wants to poll the IBF and VOMx statusbits, system 106 sets all VIMx bits to “0” during the five shift cycles.

After the five status bits have been shifted out, external system 106can determine that an output message exists and then continues shiftinga further 8, 16, 24, or 32 times depending on which VOMx bits equals“1”. The external system 106 now has assembled the first bytes of anoutput message. External system 106 continues this process of shiftingout just the IBF and VOMx bits, testing the VOMx bits and then shiftingdata bits depending on which VOMx bits equals “1”. The detection of anyVOM bit equals “0” indicates the end of the message. Once the end of themessage has been reached, external system 106 does not need to shiftadditional data bits out of shift register 1201.

Input messages longer than 4-bytes are sent as one or more 4-bytesegments followed by a segment containing fewer bytes. For each 4-bytesegment of the message, the external system 106 shifts 37 bits into TDIwith the VIMx status bits in the last positions (the positions closestto TDI). For the last segment of a message containing fewer than4-bytes, external system 106 shifts 13, 21, or 29-bits into TDI withappropriate VIMx bits indicating the number of valid bites. Duringmessage transfers, the first VIMx bit equals “0” indicates the end ofthe input message. When the length of an input message is a multiple of4-bytes, the end of the message is indicated by a 1-byte segment (13bits) with all VIMx bits equal to “0”.

The JTAG TAP controller 207 may include an input message buffer largeenough to hold the largest input message plus an output message bufferlarge enough to hold the largest output message. The DBUS messagingprotocol discussed above may allow one outstanding response in eachtransmission direction, so it is possible for external system 106 tosend a response message immediately following a new request. Flowcontrol, therefore, may be used to eliminate the possibility of everhaving a message in the input buffer overwritten before it has beenmoved into the debug circuit 103. Flow control may be performed bysending an input status buffer bit in the JTAG debug register 1201, theinput buffer status bit being adjacent to the VOM 3 bit. The externalsystem 106 can poll out just 5-bits, one of which determines whether theinput buffer can accept a new message and the other four determiningwhether there is an output message pending.

As discussed above with respect to FIG. 3, debug circuit 103 may dividedown the system bus clock frequency using a programmable divider circuit309 to provide the dm_clkout clock source for link 208A. For example,divider 309 may use a value of 0xFFFF, providing a link clock frequencyof approximately 1.5 KHz with a bus clock speed of 200 MHz. That is, theclock frequency 200 MHz may be divided by (0xFFFF*2), providing a linkclock frequency of 1525.90 Hz. The divider 309 may store a value of afield in a memory-mapped register which can be changed by host debugsoftware executing on external system 106. This memory-mapped registermay be accessed, for example, by initiating a

DBUS write command from external system 106 or any other to write avalue into the register. In some applications, the processor and busclock frequencies can by dynamically changed by power-managementsoftware of the integrated circuit 101.

By deriving link 208A clock from a bus clock, link 208 clock speedautomatically follows changes in bus clock speed allowing link 208Acommunication to be maintained over any system bus speed range. Whenprocessor 101 enters a stand-by state, a phased-locked-loop (PLL) and amaster oscillator associated with the transmit circuit may be disabledwhereby an output clock signal of the integrated circuit 101 such asdm_clkout 602 assumes a steady DC level. External system 106 may monitorthe STATUS0/STATUS1 signals 608 to determine when processor 102 hasentered a standby state.

As discussed, external system 106 may monitor a state of integratedcircuit 101, such as power management states wherein one or more modulesof integrated circuit are halted, enabling power consumption to bereduced. Power management functions may be performed by a powermanagement circuit or unit of integrated circuit 101 as is known in theart. These states may include a sleep, standby, module standby and otherstates. For example, a normal operation state indicates that processor102 of circuit 101 is currently operating normally, i.e. reading andexecuting instructions, performing system bus functions, etc. A standbystate indicates that the system clock of processor 102 is not running,and the processor 102 is not currently executing instructions or ishalted, and other on-chip supporting modules may also be halted. Whenintegrated circuit 101 is in a sleep state, a clock controller isoperating, processor 102 is halted, and one or more on-chip supportingmodules are operating. When circuit 101 is in a module standby state,the processor 102 is operating, but one or more modules are in a haltedstate.

In particular, external system 106 may monitor the STATUS0/STATUS1signals to determine the operating status of integrated circuit 101. Forexample, a value of “HH” (H=high signal level) on STATUS0/STATUS1 signalpins 608 may indicate a RESET mode wherein processor 102 has been reset.A value of “HL” (L=low signal level) on STATUS0/STATUS1 signal pins 608may indicate a sleep state. A value of “LH” on STATUS0/STATUS1 signalpins 608 may indicate a standby state, and a value of “LL” may indicatea normal operating state.

An interesting situation occurs if the integrated circuit 101 is in amodule standby state wherein one or more of the supporting modules arepowered down, but the processor is operating. If external system 106attempts to perform a bus transaction such as by sending a DBUS requestmessage to a module is powered down, an arbiter associated with systembus 105 provides an error response to external system 106. In one aspectof the invention, the arbiter is aware of the states of each moduleassociated with bus 105 and monitors bus transactions between themodules. If the arbiter detects a DBUS request to a powered-down module,the arbiter generates a DBUS response indicating an error, which will betransferred to the external system 106.

The DBUS response may not indicate the cause of the error. In this case,external system 106 may, in response to receiving the DBUS errorresponse, read a memory-mapped register in integrated circuit 101 thatindicates the powered-down module's state. If the register indicates anerror, external system 106 determines that the error is not due to apower-management power-down of the module. If the register indicates noerror, the external system 106 determines that the module is powereddown. External system 106 may also access registers of the powermanagement unit to verify the state of the module, and may power-up themodule if required.

External system 106 such as debug software tool may issue a command to“wake-up” processor 101 from a standby state to place it in a normaloperating state. However, it is realized that once a wake-up command hasbeen issued, it can take a period of time for a transmission PLL tostabilize and for internal clocks of circuit 101 to be enabled. Thedebug software tool may be adapted to monitor the STATUS0 and STATUS1signals and delay any DBUS request messages until integrated circuit 101is operating in a sleep state wherein normal clock pulses resume onsignal dm_clkout 602.

When processor 102 is in a standby state, there are no clock pulsesoccurring on dm_clkout 602. However, external system 106 can generateclock pulses on dm_clkin 605 using an external clock 106. This allowsexternal system 106 to send a “wake-up” message to, processor 102. Themessage may be, for example, a single byte message. This byte isassembled in an input buffer of debug circuit 103 by a state machineusing dm_clkin signal 605. This state machine detects that a byte hasbeen received by external system 106, that the processor 102 is instandby state, and so the state machine asserts a wake-up signal to apower management unit of processor 102 (not shown).

As discussed, external system 106 may monitor integrated circuit 101during a reset sequence. In particular, three pins may be sampled fromeither interfaces 208A or 208B during a reset sequence which allow thefollowing to be performed as shown in FIG. 14:

Debug circuit to be enabled or disabled.

The signal used to enable or disable the debug module is referred to asDM_ENABLE. When using link 208A, for example, the signal is obtained bysampling the dm_clkin 606 signal during reset.

Processor to be brought up in a suspended or running state. The signalused to accomplish this is referred to as the SUSPEND signal. When usinglink 208A, the signal is obtained by sampling the dm_isync 607 pinduring a reset.

Reset to be forced by a DEBUG reset, rather than the normal POWERON orMANUAL reset performed by transmitting signals on the {overscore(RESETP)} 608 and {overscore (RESETM)} 609 pins. The signal used isreferred to as RESET_MODE. The signal is obtained by sampling the dm_in606 signal during a reset of circuit 101.

According to one aspect of the invention, a reference message may besent to an external system 106 in predetermined intervals, such thatinformation may be kept current at system 106. Particularly, thereference message may indicate timing information to external system106, such that system 106 may be apprised of the current time in debugcircuit 103. Also, relative timing information in trace messagesfollowing the reference message may be calculated from the referencemessage timing information. Further, the reference message may include acopy of the program counter value stored in debug circuit 103, such thatrelative program counter information in trace messages following thereference message may be calculated from the reference message programcounter value. Further, address information may also be included in thereference message for the purpose of calculating offset addresses. Thetiming information program counter, and address information may beabsolute values.

Also, a reference message may be sent to external system 106 duringcontinuous idle periods greater than a predetermined number of timeintervals. For example, a predetermined time interval may be 256 timeintervals. That is, if a transmission circuit 215 has been idle for morethan 256 intervals prior to sending a trace message, a reference messagemay be inserted into a first-in first-out (FIFO) buffer of trace storageunit 205 before the next trace message.

Table 8 below shows one embodiment of a format and content of areference message:

TABLE 7 Reference Message Reference Message (14-bytes) Header Bit FieldSize Positions Description Message Type 3-bits [0, 2] 0b100 Reserved5-bits [3, 7] Time Value 5-bytes N/A The value of a 40-bit timestampcounter in the debug circuit. PC Address 4-bytes The absolute 4-byteaddress of a shadowed program counter in the debug circuit at the timethis message is generated. This address becomes a new reference PC valueand the relative address in a trace message which follows will be basedon this value. BA Address 4-bytes The absolute 4-byte reference addressassociated with the bus analyzer (BA). This value becomes the new busanalyzer reference address and the relative address in a bus analyzertrace message which follows will be based on this value.

Debug circuit 103 may include a register which determines whethertimestamps are included in trace messages. If included, the timestampfield of a trace message such as that shown in Table 1 may be used tospecify a time difference from the last reference message.Alternatively, the timestamp field may contain an absolute value of atimestamp.

An external system 106 such as a debug tool may connect to an integratedcircuit 101 via a JTAG debug link as shown in FIG. 14. For debug toolssuch as an E10A debug tool available from the Hitachi Limited, the RESETsignal in the JTAG interface 208B is an output from the target boardwhich allows the tool to detect when a board-level reset function hasoccurred, for example, when a user has pressed a reset button such asthe switch associated with a power generation and reset unit 1001.However, some tools may not have the capability to initiate a POWERON,MANUAL or DEBUG reset via signals in the interface. However, a facilityis provided such that the debug tool can perform either a processorreset (which resets the processor) or a DEBUG reset (which resets thedebug circuit) by writing to a register of debug circuit. A RESET_MODEsignal is assigned to an external link pin not currently connected andthis allows the tool to force a DEBUG reset when the reset button inunit 1001 is pressed. The RESET signal in the JTAG debug interface couldbe bidirectional allowing the tool to initiate one type of hard reset,either POWERON, MANUAL or DEBUG depending on board-level jumpers asshown in FIG. 14.

A debug tool such as an ST JEI debug adapter available fromSTMicroelectronics, Inc. connects to integrated circuit 101 using link208A as shown in FIG. 14. The tool is able to directly reset processor102 using the RESET signal of interface 208A. A jumper on the targetboard connects this signal to either the {overscore (RESETP)} pin or the{overscore (RESETM)} pin. As part of the reset function initiated wheneither the {overscore (RESETP)} pin or the {overscore (RESETM)} pin ispulsed low, integrated circuit 101 senses the state of signal dm_in. Ifsignal dm_in is sampled low, a DEBUG reset is initiated regardless ofwhether the {overscore (RESETP)} pin or the {overscore (RESETM)} pin wasasserted. Also, a DEBUG reset from a tool connected to link 208A canalso be performed by writing to debug circuit register 209.

Integrated circuit 101 may have a suspend function which suspends theperformance of processor 102. The dm_isync signal 607 has two functions.Its primary function is the synchronization pin for messages sent tointegrated circuit 101 from external system 106. Its secondary functioncontrols processor suspend state. At the end of a POWERON, MANUAL orDEBUG reset function, when RESET is pulled high, the processor caneither start executing boot code or can enter a suspended statedepending on the state of the dm_isync signal 607 sampled when RESETgoes from low to high. If dm_isync 607 is sampled low at the end of thereset phase, the processor may remain suspended on the assumption thatvarious processor registers will be loaded by an external system 106. Atsome later time, external system 106 will release the processor from itssuspended state by writing to debug register 209. If signal dm_isync 607is sampled high at the end of the reset phase, the processor startsexecuting boot code. A pin associated with the dm_isync signal 607 mayinclude an internal pull-up resistor to ensure that when no externalsystem 106 is connected to link 208A, the processor is not suspended atthe end of reset. Table 8 below lists one embodiment of reset functionsperformed using the {overscore (RESETP)} and {overscore (RESETM)}signals:

TABLE 8 Alternative Reset Functions Action When Action When dm_in State{overscore (RESETP)} Asserted {overscore (RESETM)} Asserted high(internal pull-up resistor) POWERON reset. MANUAL reset. low DEBUGreset. DEBUG reset.

The processor suspend function is also available to JTAG-connectedtools. The JTAG debug link signal SUSPEND is an AC-decoupled version ofthe dm_isync signal 607 of link 208A. Since dm_isync 607 is a high-speedsignal used by link 208A, board-level products may include a seriesresistor between SUSPEND pin in the JTAG header and the dm_isync signalpin. This series resistor (of value around 1 K ohm, for example) islocated close to the dm_isync signal pin to minimize effects of extratrace length on a printed circuit board. A bypass capacitor may also berequired.

FIGS. 15 and 16 show timings described above for resetting of processor102 by applying an external signal and writing to a debug register 209,respectively. In FIG. 15, either a {overscore (RESETP)} or {overscore(RESETM)} signal corresponding to a POWERON reset or MANUAL reset,respectively, is held low to cause a reset of processor 102. Asdiscussed above, external system 106 may monitor signal dm_in 606 todetermine whether a reset has occurred. After n clock cycles, the resetof processor 102 is complete. External system 106 may monitorSTATUS0/STATUS1 signals 108 to determine whether circuit 101 isoperating normally and can receive requests. When the circuit 101 isoperating normally, signal dm_clkin signal 605 may be sampled and adebug circuit state determined. Also, signal dm_isync 607 may be sampledand the processor suspend state determined. At some later time aftercircuit 101 has stabilized, processor 102 may begin fetching andexecuting instructions. It is noted that the transmission speedassociated with a link may change as a result of resetting circuit 101.

In FIG. 16, an external system may reset circuit 101 by writing a valueto a register, such as a register called WPC.CPU_CTRL_ACTION. The valuemay be, for example, a value representing a debug reset opcode, whichmay be any predefined value. After the opcode is written into theregister, the reset procedure may be similar to that described abovewith respect to providing a POWERON or MANUAL reset. For example,external system 106 may monitor STATUS0/STATUS1 signals 108 to determinewhether circuit 101 is operating normally. It should be understood thatdifferent timing relationships may be used between the signals todetermine when integrated circuit 101 is operational.

While various embodiments of the present invention have been describedabove, it should be understood that they have been presented by way ofexample only, and not limitation. Thus, the breadth and scope of thepresent invention are not limited by any of the above exemplaryembodiments, but are defined only in accordance with the followingclaims and their equivalents.

What is claimed is:
 1. A method for communicating between an integratedcircuit and an off-chip device, the method comprising steps of:transmitting a message off-chip at a transmission frequency proportionalto an on-chip system bus transmission frequency; automatically adjustingthe transmission frequency in response to a change in bus transmissionfrequency.
 2. The method according to claim 1, wherein the transmissionfrequency is proportional to the bus transmission frequency by a wholenumber.
 3. The method according to claim 1, wherein a degree ofproportionality may be changed by manipulating a register associatedwith a programmable divider circuit.
 4. The method according to claim 3wherein the register is manipulated by at least one of an externalsystem and an on-chip device.
 5. The method according to claim 1,wherein a value of a receive frequency depends upon a value of thetransmission frequency.
 6. The method according to claim 1, wherein thetransmission frequency is determined by a divider circuit, wherein thedivider circuit determines the transmission frequency based on the bustransmission frequency and a divider value stored in a registerassociated with the integrated circuit.
 7. The method according to claim6, wherein the divider value is a default value upon a reset of theintegrated circuit device.
 8. The method according to claim 7, whereinthe off-chip device initiates the reset, and changes its receptionfrequency to adapt to the default value.
 9. The method according toclaim 6, wherein the divider circuit resets the transmission frequencyto a default value upon a reset of the integrated circuit.
 10. Anintegrated circuit comprising: a system bus having a system busfrequency; a communication circuit for transmitting messages at atransmission frequency between the integrated circuit and an off-chipdevice; and a divider circuit, operatively coupled to the system bus andthe communication circuit, the divider being configured to adjust thetransmission frequency in response to a change in system bus frequency.11. The integrated circuit according to claim 10, wherein thetransmission frequency is kept proportional to the system bus frequency.12. The integrated circuit according to claim 11, wherein thetransmission frequency is proportional to the bus transmission frequencyby a whole number.
 13. The integrated circuit according to claim 10, theintegrated circuit further comprising a register, and data stored withinthe register determines a degree of proportionality between thetransmission frequency and the system bus frequency.
 14. The integratedcircuit according to claim 13, wherein the communication circuitincludes an interface to the off-chip device, and the communicationcircuit is adapted to receive a request message from the off-chip deviceto write a data value in the register which determines the degree ofproportionality.
 15. The integrated circuit according to claim 10,wherein a receive frequency of the communication circuit depends uponthe transmission frequency.
 16. The integrated circuit according toclaim 10, wherein the divider circuit determines the transmissionfrequency based on the bus transmission frequency and a divider valuestored in a register associated with the integrated circuit.
 17. Theintegrated circuit according to claim 16, wherein the divider value is adefault value upon a reset of the integrated circuit device.
 18. Theintegrated circuit according to claim 17, wherein the off-chip deviceinitiates the reset, and changes its reception frequency to adapt to thedefault value.
 19. The integrated circuit according to claim 16, whereinthe divider circuit resets the transmission frequency to a default valueupon a reset of the integrated circuit.